<%-- Copyright 2009 Google Inc. All Rights Reserved. --%>
<%--
  This page contains the view shown after users have logged in but need to get a valid
  authorization token.
 --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="spanishgringo.data.GoogleData" %>
<%
  GoogleData googleData = (GoogleData)request.getAttribute("googleData");
%>
<!DOCTYPE html>
<html>
<head>
  <meta charset='utf-8'>
  <meta http-equiv="X-UA-Compatible" content="chrome=1">
  <meta http-equiv="description" content="Authorization Page: GA Evolution let you easily export your data from Google Analytics, use segments, compare different profiles and build graphs.">
  <title>Google Analytics Evolution Account Authorization| by Spanishgringo</title>
  <link rel="stylesheet" href="css/styles.css" type="text/css" />
</head>
<body>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1683366-9']);
  _gaq.push(['_trackPageview', '/Main/Auth']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  })();

</script>
	
<div id="wrapper">
  <h1>Google Analytics Evolution - by Spanishgringo</h1>
  <div class="blogWrap"><a href="http://spanishgringo.blogspot.com">My Blog: SEO, Web Marketing &amp; More</a></div>
  <hr></hr>
  
  <p class="">This application requires access to your Google
    Analytics account. When you click the link below,<br/>
    you will be taken to a page hosted on Google to grant this application
    access.
  </p>

  <a href="<%= googleData.getAuthorizationUrl() %>">Authorize with Google Analytics</a>
<%
  if (googleData.getAuthorizationErrorMessage() != null) {
    out.println(String.format("<p>Error authorizing access to this applications: %s</p>",
        googleData.getAuthorizationErrorMessage()));
  }
%>
<p>Or you can: <a href=" <%= googleData.getAuthenticationUrl() %>">Log Out</a></p>
</div>
<div class="browserMsg">Works best with Firefox and Chrome <img  width="116" height="23" src="images/app-engine-logo.png"/></div>
</body>
</html>